home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ May 89 / U0047-Files By Date Scrip-May89 < prev    next >
Encoding:
Text File  |  1989-06-26  |  1.6 KB  |  55 lines  |  [TEXT/GEOL]

  1. Item    0304395                         21-May-89        20:25
  2.  
  3. From:   D0416                           Futuresoft System Design, PRT
  4.  
  5. To:     D2086                           Efficient Field Svc, C Faith, PRT
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Files By Date Script
  10.  
  11. Curtis,
  12.  
  13. You asked me on Compuserve if I had a script to sort files by date. I found a
  14. Link on my hard drive that does just that if you haven’t already. You could
  15. then use that as input into something else.
  16.  
  17. Hope this helps, -Ken Addison
  18.  
  19. The link follows:
  20.  
  21. ****** L I N K   B E G I N N I N G  *****
  22. From:   REKIETA1                        Rekieta, Paul
  23.  
  24. To:     D0756                           Tradenet, Dev, Adam Wildavsky
  25.  
  26. cc:     D1220                           VarLite, Dev, Andy Meldrum
  27.         MACAPP.TECH$                    MACAPP Tech
  28.  
  29. Sub:    files by date
  30.  
  31.  
  32. A little bit simpler would be the following command line:
  33.  
  34.  files -t TEXT -n -x m | sort -quote -d -f '4,2,3,7,5,6,1' -fs ' /:' ≥ dev:null
  35.  
  36. Your three step sort could be done in one pass.
  37.  
  38. The -f option takes field numbers as multiple keys as follows:
  39.     4 = yy, 2 = mm, 3 = dd, 7 = AM/PM, 5 = HH, 6 = MM, 1 = file name
  40.  
  41. The -fs options specified field seperators as: (space) or / or :
  42.  
  43. The -quote option is necessary to treat quoted fields (like the file name) as
  44. one field.
  45.  
  46. The ≥ redirection gets rid of a warning message produced by the sort tool. When
  47. reading piped input, it can't get tab settings and so it issues a message.
  48.  
  49. Paul Rekieta
  50. Apple Computer
  51. Communications Product Development
  52. ************ E N D   O F   L I N K **************
  53.  
  54.  
  55.